package lunsfordhall.androidapp;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class circumferenceofacircle extends Activity{

	public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        setContentView(R.layout.circumferenceofacircle);
        
        
        final EditText edittext2 = (EditText) findViewById(R.id.edittext2);
        
        final Button button = (Button) findViewById(R.id.button1);
        
        button.setOnClickListener(new OnClickListener() {
        	public void onClick(View v) {
        		 TextView t = (TextView)findViewById(R.id.textview);
        		 double answer = 0;
              	
              	double diameter = Double.parseDouble(edittext2.getText().toString());
              	answer = Math.PI * diameter;
              	t.setText("The circumference of the circle is: "+String.valueOf(answer));
	}
	
});
            
	}
}